package com.jf.identity.holder;

import com.jf.identity.entity.ExamBaseParam;
import org.springframework.stereotype.Component;

@Component
public class ExamBaseParamHolder {
    private volatile ThreadLocal<ExamBaseParam> threadLocal = new ThreadLocal<>();

    public ExamBaseParam getExamBaseParam() {
        return ExamBaseParam.copyOf(threadLocal.get());
    }

    public void setExamBaseParam(ExamBaseParam examBaseParam) {
        threadLocal.set(ExamBaseParam.copyOf(examBaseParam));
    }

    public void remove() {
        threadLocal.remove();
    }
}
